/*
 * (C) Copyright 2016 Ymatou (http://www.ymatou.com/).
 * 
 * All rights reserved.
 */
package com.ymatou.iapi.trading.operate.parameter;

import java.math.BigDecimal;

import com.ymatou.iapi.trading.operate.parameter.enums.BondedAreaEnum;
import com.ymatou.iapi.trading.operate.parameter.enums.LogisticsTypeEnum;
import com.ymatou.iapi.trading.operate.parameter.enums.PriceTypeEnum;
import com.ymatou.iapi.trading.operate.parameter.enums.ProductRefundChannelEnum;
import com.ymatou.iapi.trading.operate.parameter.enums.SalesTypeEnum;
import com.ymatou.iapi.trading.operate.parameter.enums.StockStatusEnum;

/**
 * 订单里商品项
 * 
 * @author tuwenjie 2016年5月7日 下午5:43:23
 *
 */
public class OrderItemVo extends PrintFriendliness {

	private static final Long serialVersionUID = -1835126454024646839L;

	// 商品ID
	private String productId;

	// 商品名称
	private String productName;

	// 商品规格ID
	private String catalogId;

	// 备货状态
	private StockStatusEnum stockStatus;

	// 商品数量
	private int productNum;

	// 一级目录ID
	private int firstCategoryId;

	// 二级目录ID
	private int secondCategoryId;

	// 三级目录ID
	private int thirdCategoryId;

	// 商品品牌ID
	private int brandId;

	// 商品URL
	private String pictureUrl;

	// 商品属性信息(按JSON格式存储，如--颜色:黑色,尺寸:XXS)
	private String property;

	// 商品成交价
	private BigDecimal productPrice;

	// 商品预付定金
	private BigDecimal earnestPrice;

	// 商品原价
	private BigDecimal originalPrice;

	// 成交价类型
	private PriceTypeEnum priceType;

	// 关税承担类型(0-卖家承担 1-买家承担)
	private int tariffType;

	// 物流类型
	private LogisticsTypeEnum logisticsType;

	// 保税区
	private BondedAreaEnum bondedArea;

	// 商品备案号
	private String productRecordNo;

	// SKU
	private String sku;

	// 套餐编号
	private String packageNo;

	// 商品退货渠道
	private ProductRefundChannelEnum productRefundChannel;

	// 商品信息（格式:Json）
	private String productDetailInfo;
	// 是否包邮
	private boolean freightFree;

	//是否是预售商品
	private boolean preSale;

	//商品快照版本
	private String productVer;

	//是否psp商品 （psp: prefer sale promotion）
	private boolean pspProduct;

	//运费		add 20170612
	private BigDecimal freight;

	/** 库存  add 20170710
	* 活动限购数量,不限购值为 0
	*/
	private int stockActivityLimitNumber;

	/**
	 * 商品限购数量，不限购值为 0
	 */
	private int stockLimitNumber;

	/**
	 * 商品限购起始时间，不限购值为 1900-1-1
	 */
	private String stockLimitStartTime;

	/**
	* 是否是组合商品
	*/
	private boolean subProduct;

	public BigDecimal getFreight() {
		return freight;
	}

	public void setFreight(BigDecimal freight) {
		this.freight = freight;
	}

	public String getProductVer() {
		return productVer;
	}

	public void setProductVer(String productVer) {
		this.productVer = productVer;
	}

	public boolean getPspProduct() {
		return pspProduct;
	}

	public void setPspProduct(boolean pspProduct) {
		this.pspProduct = pspProduct;
	}

	public boolean getPreSale() {
		return preSale;
	}

	public void setPreSale(boolean preSale) {
		this.preSale = preSale;
	}

	public boolean getFreightFree() {
		return freightFree;
	}

	public void setFreightFree(boolean freightFree) {
		this.freightFree = freightFree;
	}

	// 是否支持7天无条件退货
	private boolean supportsRtnWithoutReason;

	public boolean getSupportsRtnWithoutReason() {
		return supportsRtnWithoutReason;
	}

	public void setSupportsRtnWithoutReason(boolean supportsRtnWithoutReason) {
		this.supportsRtnWithoutReason = supportsRtnWithoutReason;
	}

	// 以下新增的参数，用来测试校验数据用，跟协议无关
	// 商家优惠对应到商品的优惠信息
	private SellerPromotionVo SellerPromotion;

	// 分摊到订单商品上的商家优惠金额
	private BigDecimal sellerPromotionAmount = BigDecimal.ZERO;;

	// 该商品分摊到的商家优惠券面值
	private BigDecimal sellerCouponValue = BigDecimal.ZERO;

	// 该商品分摊到的平台优惠券面值
	private BigDecimal ymatouCouponValue = BigDecimal.ZERO;

	// 分摊到各个商品下的运费
	private BigDecimal dividedFreight;

	// 商家id  add by sean 03-31 
	private int sellerId;

	public int getSellerId() {
		return sellerId;
	}

	public void setSellerId(int sellerId) {
		this.sellerId = sellerId;
	}

	public BigDecimal getDividedFreight() {
		return dividedFreight;
	}

	public void setDividedFreight(BigDecimal dividedFreight) {
		this.dividedFreight = dividedFreight;
	}

	public BigDecimal getSellerPromotionAmount() {
		return sellerPromotionAmount;
	}

	public void setSellerPromotionAmount(BigDecimal sellerPromotionAmount) {
		this.sellerPromotionAmount = sellerPromotionAmount;
	}

	public SellerPromotionVo getSellerPromotion() {
		return SellerPromotion;
	}

	public void setSellerPromotion(SellerPromotionVo sellerPromotion) {
		SellerPromotion = sellerPromotion;
	}

	public BigDecimal getSellerCouponValue() {
		return sellerCouponValue;
	}

	public void setSellerCouponValue(BigDecimal sellerCouponValue) {
		this.sellerCouponValue = sellerCouponValue;
	}

	public BigDecimal getYmatouCouponValue() {
		return ymatouCouponValue;
	}

	public void setYmatouCouponValue(BigDecimal ymatouCouponValue) {
		this.ymatouCouponValue = ymatouCouponValue;
	}

	// 新增2个计算商品总定金价，总成交价
	public BigDecimal getTotalEarnestPrice() {
		return this.earnestPrice.multiply(new BigDecimal(this.productNum));
	}

	public BigDecimal getTotalProductPrice() {
		return this.productPrice.multiply(new BigDecimal(this.productNum));
	}

	// 商品活动信息
	private ActivityVo activity;

	private SalesTypeEnum salesType;

	public SalesTypeEnum getSalesType() {
		return salesType;
	}

	public void setSalesType(SalesTypeEnum salesType) {
		this.salesType = salesType;
	}

	public String getProductId() {
		return productId;
	}

	public void setProductId(String productId) {
		this.productId = productId;
	}

	public String getProductName() {
		return productName;
	}

	public void setProductName(String productName) {
		this.productName = productName;
	}

	public String getCatalogId() {
		return catalogId;
	}

	public void setCatalogId(String catalogId) {
		this.catalogId = catalogId;
	}

	public StockStatusEnum getStockStatus() {
		return stockStatus;
	}

	public void setStockStatus(StockStatusEnum stockStatus) {
		this.stockStatus = stockStatus;
	}

	public int getProductNum() {
		return productNum;
	}

	public void setProductNum(int productNum) {
		this.productNum = productNum;
	}

	public int getFirstCategoryId() {
		return firstCategoryId;
	}

	public void setFirstCategoryId(int firstCategoryId) {
		this.firstCategoryId = firstCategoryId;
	}

	public int getSecondCategoryId() {
		return secondCategoryId;
	}

	public void setSecondCategoryId(int secondCategoryId) {
		this.secondCategoryId = secondCategoryId;
	}

	public int getThirdCategoryId() {
		return thirdCategoryId;
	}

	public void setThirdCategoryId(int thirdCategoryId) {
		this.thirdCategoryId = thirdCategoryId;
	}

	public int getBrandId() {
		return brandId;
	}

	public void setBrandId(int brandId) {
		this.brandId = brandId;
	}

	public String getPictureUrl() {
		return pictureUrl;
	}

	public void setPictureUrl(String pictureUrl) {
		this.pictureUrl = pictureUrl;
	}

	public String getProperty() {
		return property;
	}

	public void setProperty(String property) {
		this.property = property;
	}

	public BigDecimal getProductPrice() {
		return productPrice;
	}

	public void setProductPrice(BigDecimal productPrice) {
		this.productPrice = productPrice;
	}

	public BigDecimal getEarnestPrice() {
		return earnestPrice;
	}

	public void setEarnestPrice(BigDecimal earnestPrice) {
		this.earnestPrice = earnestPrice;
	}

	public BigDecimal getOriginalPrice() {
		return originalPrice;
	}

	public void setOriginalPrice(BigDecimal originalPrice) {
		this.originalPrice = originalPrice;
	}

	public int getTariffType() {
		return tariffType;
	}

	public void setTariffType(int tariffType) {
		this.tariffType = tariffType;
	}

	public LogisticsTypeEnum getLogisticsType() {
		return logisticsType;
	}

	public void setLogisticsType(LogisticsTypeEnum logisticsType) {
		this.logisticsType = logisticsType;
	}

	public BondedAreaEnum getBondedArea() {
		return bondedArea;
	}

	public void setBondedArea(BondedAreaEnum bondedArea) {
		this.bondedArea = bondedArea;
	}

	public String getProductRecordNo() {
		return productRecordNo;
	}

	public void setProductRecordNo(String productRecordNo) {
		this.productRecordNo = productRecordNo;
	}

	public String getSku() {
		return sku;
	}

	public void setSku(String sku) {
		this.sku = sku;
	}

	public String getPackageNo() {
		return packageNo;
	}

	public void setPackageNo(String packageNo) {
		this.packageNo = packageNo;
	}

	public ProductRefundChannelEnum getProductRefundChannel() {
		return productRefundChannel;
	}

	public void setProductRefundChannel(
			ProductRefundChannelEnum productRefundChannel) {
		this.productRefundChannel = productRefundChannel;
	}

	public String getProductDetailInfo() {
		return productDetailInfo;
	}

	public void setProductDetailInfo(String productDetailInfo) {
		this.productDetailInfo = productDetailInfo;
	}

	public ActivityVo getActivity() {
		return activity;
	}

	public void setActivity(ActivityVo activity) {
		this.activity = activity;
	}

	public PriceTypeEnum getPriceType() {
		return priceType;
	}

	public void setPriceType(PriceTypeEnum priceType) {
		this.priceType = priceType;
	}

	public int getStockActivityLimitNumber() {
		return stockActivityLimitNumber;
	}

	public void setStockActivityLimitNumber(int stockActivityLimitNumber) {
		this.stockActivityLimitNumber = stockActivityLimitNumber;
	}

	public int getStockLimitNumber() {
		return stockLimitNumber;
	}

	public void setStockLimitNumber(int stockLimitNumber) {
		this.stockLimitNumber = stockLimitNumber;
	}

	public String getStockLimitStartTime() {
		return stockLimitStartTime;
	}

	public void setStockLimitStartTime(String stockLimitStartTime) {
		this.stockLimitStartTime = stockLimitStartTime;
	}

	public boolean isSubProduct() {
		return subProduct;
	}

	public void setSubProduct(boolean subProduct) {
		this.subProduct = subProduct;
	}

	public static Long getSerialversionuid() {
		return serialVersionUID;
	}

}
